<?php

/*
 * Object/Email.php
 */

namespace RHX\Model\Object;

use Zend\Db\Adapter\Adapter;

class Email {

    public $id;
    public $libelle;
    public $email;
    public $description;

    /**
     * Database Adapter
     *
     * @var Adapter
     */
    protected $adapter;

    /**
     * Constructeur
     *
     * @param \Zend\Db\Adapter\Adapter $adapter
     * @param array $data
     */
    public function __construct(Adapter $adapter, $data = array()) {
	$this->adapter = $adapter;
	$this->exchangeArray($data);
    }

    /**
     * Remplir les données
     *
     * @param array $data
     */
    public function exchangeArray($data = array()) {
	$this->id		 = isset($data['id']) ? $data['id'] : null;
	$this->libelle		 = isset($data['libelle']) ? $data['libelle'] : '';
	$this->email		 = isset($data['email']) ? $data['email'] : '';
	$this->description	 = isset($data['description']) ? $data['description'] : '';
    }

    /**
     * Copier les variables dans un tableau
     *
     * @return array
     */
    public function getArrayCopy() {
	return get_object_vars($this);
    }

}

?>
